<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>安排考试时间</title>
    <link href="../../static/css/bootstrap.min.css" rel="stylesheet" th:href="@{/static/css/bootstrap.min.css}">
    <!-- Custom styles for this template -->
    <link href="../../static/css/dashboard.css" rel="stylesheet" th:href="@{/static/css/dashboard.css}">
</head>
<body>
<div th:insert="admin/common::topbar"></div>
<div class="container-fluid">
    <div class="row">
        <!--侧边栏-->
        <div th:insert="~{admin/common::sidebar(active='examArrange.html')}">
        </div>
        <!--"-->
        <main class="col-md-9 ml-sm-auto col-lg-10 pt-3 px-4" role="main">
            <div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pb-2 mb-3 border-bottom">
                <h1 class="h3">安排考试时间</h1>
                <div class="btn-toolbar mb-2 mb-md-0">
                    <div class="btn-group mr-2">
                        <button class="btn btn-sm btn-outline-secondary" id="btn-quit-arrange-examTime">退出编辑</button>
                    </div>
                    <div class="btn-group mr-2">
                        <!--  -->
                        <button class="btn btn-primary btn-sm btn-outline-secondary" id="btn-admin">管理员</button>
                        <button class="btn btn-sm btn-outline-secondary" id="btn-student">学生端</button>
                    </div>
                </div>
            </div>
            <form class="container-fluid col-md-5 col-md-pull-3" id="myForm" method="post"
                  th:action="@{/admin/arrangeExamTime}">
                <p th:if="${not #strings.isEmpty(error)}" th:text="${error}"></p>
                <div class="form-group form-inline" hidden>
                    <label class="form-check-inline" for="exam_id">考试编号:</label>
                    <input class="form-control" id="exam_id" name="exam_id" readonly th:value="${exam.getExam_id()}"
                           type="text">
                </div>
                <div class="form-group form-inline">
                    <label class="form-check-inline" for="exam_name">考试名称:</label>
                    <input class="form-control" id="exam_name" name="exam_name" readonly
                           th:value="${exam.getExam_name()}" type="text">
                </div>
                <div class="form-group form-inline" hidden>
                    <label class="form-check-inline" for="exam_cid">考试科目编号:</label>
                    <input class="form-control" id="exam_cid" name="exam_cid" readonly th:value="${exam.getExam_cid()}"
                           type="text">
                </div>
                <div class="form-group form-inline">
                    <label class="form-check-inline" for="exam_cname">考试科目:</label>
                    <input class="form-control" id="exam_cname" name="exam_cname" readonly
                           th:value="${exam.getExam_cname()}" type="text">
                </div>
                <div class="form-group form-inline">
                    <label class="form-check-inline" for="exam_date">考试日期:</label>
                    <input class="form-control" id="exam_date" name="exam_date" type="date">
                </div>
                <div class="form-group form-inline">
                    <label class="form-check-inline" for="exam_time">考试时间:</label>
                    <select class="form-control" id="exam_time" name="exam_time">
                        <option th:each="time:${timeList}" th:text="${time.getDuration()}"
                                th:value="${time.getDuration()}"></option>
                    </select>
                    <!--<input class="form-control" name="exam_time" id="exam_time" type="text">-->
                </div>
                <div class="form-group form-inline">
                    <button class="btn btn-primary " id="button" type="submit">添加</button>
                </div>
            </form>
        </main>
    </div>
</div>
<script src="../../static/js/jquery-3.6.0.min.js" th:src="@{/static/js/jquery-3.6.0.min.js}"
        type="text/javascript"></script>
<script src="../../static/js/bootstrap.min.js" th:src="@{/static/js/bootstrap.min.js}" type="text/javascript"></script>
<script src="../../static/js/btn.js" th:src="@{/static/js/btn.js}"></script>
<script>
    $('#btn-quit-arrange-examTime').click(function () {
        let exam_id = [[${exam.getExam_id()}]];
        $(location).attr('href', '/admin/getExamSubjectList/' + exam_id);
    })
</script>
</body>
</html>